<?php
include "./connect.php";

$usernam=$_POST['username'];
$passwrod=$_POST['password'];

$res=mysqli_query($con,"select * from user where username='$usernam' and password = '$passwrod'");
$row = mysqli_fetch_assoc($res);
if($row){
    $arr = [
        "meta"=>[
            "status"=>0,
            "msg"=>"登录成功"
        ],
        "data"=>null
    ];
}else{
    $arr = [
        "meta"=>[
            "status"=>1,
            "msg"=>"登录失败"
        ],
        "data"=>null
    ];
}

echo json_encode($arr);